import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login'
import Layout from '@/layout'
Vue.use(VueRouter)

const routes = [
  { path: '/login', component: Login },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      { path: 'home', component: () => import('@/views/home') },
      { path: 'people', component: () => import('@/views/people-admin') },
      {
        path: 'work',
        component: () => import('@/views/people-admin/work.vue')
      },
      {
        path: 'census',
        component: () => import('@/views/people-admin/census.vue')
      },
      { path: '/task-business', component: () => import('@/views/business') },
      { path: '/task-operation', component: () => import('@/views/operation') },
      { path: '/order', component: () => import('@/views/order') },
      { path: '/guanli', component: () => import('@/views/guanli') },
      { path: '/commodiy', component: () => import('@/views/commodiy') },
      { path: '/duizhang', component: () => import('@/views/duizhang') },
      { path: '/policy', component: () => import('@/views/policy') },
      {
        path: '/devicemanage',
        component: () => import('@/views/devicemanage')
      },
      { path: '/devicestate', component: () => import('@/views/devicestate') },
      { path: '/typemanage', component: () => import('@/views/typemanage') },
      {
        path: '/zonemanagement',
        component: () => import('@/views/ZoneManagement')
      },
      {
        path: '/partnermanagement',
        component: () => import('@/views/PartnerManagement')
      },
      {
        path: '/pointManagement',
        component: () => import('@/views/PointManagement')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
